Comparable * p ***> is: 0Persion3 @ 07, hasCode is: 0 * p ***> is: 1Persion3 @ 01, hasCode is: 0 * p ***> is: 2Persion3 @ 03, hasCode is: 0 * p ***> is: 4Persion3 @ 06, hasCode is: 0 * p ***> is: 5Persion3 @ 04, hasCode is: 0 * p ***> is: 8Persion3 @ 02, hasCode is: 0 * p ***> is: 9Persion3 @ 05, hasCode is: 0 * sort by Age */Set
SortSet = new TreeSet
(); Persion3 pf1 = new Persion3 (1); Persion3 pf2 = new Persion3 (8); Persion3 pf3 = new Persion3 (2); Persio
1. design requirements
EM-STM3210E Development Board has a LED lamp D1, write a program to light up the light.
2. hardware circuit connection
On the Development Board, D1 is connected to the PF6 pin on the STM32F103ZE chip, as shown in.
3. Software Programming
According to the task requirements, the program content mainly includes:
1. configure Reset and clock control (RCC) to enable the clock of the GPIOF port Module
2. Configure the
#defineLed2_port Gpioe#defineLed2_pin Gpio_pin_5#defineLED3_CLK Rcc_apb2periph_gpiob#defineLed3_port Gpiob#defineLed3_pin Gpio_pin_5#defineLED2 Peout (5)//PF6#defineLED3 Pbout (5)//PF7voidLed_init (void);voidLed2_init (void);voidLed3_init (void);voiddebug_led (U8 x);#endif/******************************************************************************* file LED.c* author Belye* version S T v3.5.0* Date 03-february-2016* The underlying driver for LEDs b
0x00010000 {; load region size_region
ER_IROM1 0x08010000 0x00010000 {; load address = execution address
}
RW_IRAM1 0x20000400 0x00002000 {; RW data
. ANY (+ RW + ZI)
}
}
It indicates that the program is loaded at 0x08010000, the size is 64 K, and the RAM space is the 8 K space starting from 0x20000400.
Note:In addition to the available RAM, user drivers can also allocate memory on the heap directly through the memory operation functions provided by interfaces.
5. Write the user driver (C/C ++
. pin [] {pins. pc0, pins. pf9, pins. pf7, pins. pf5, pins. PF3, pins. pf1, pins. pf2, pins. pf4, pins. pf6, pins. pf8, pins. pf10, pins. pC1}; led4.ishex = True ; // Display in hexadecimal format Led4.start (); VaR K = 0 ; For ( Int I = 0 ; I 20000 ; I ++ ){ For ( Int J = 0 ; J ) {LEDs [J]. Write (K = J );} If (K ++> = LEDs. Length) k = 0 ; Led4.value = I; thread. Sleep ( 50 );} Led4.stop ();
Everything is ready! SetProgramWrite to
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.